package com.moetube.video.feign;

import com.moetube.entity.Result;
import com.moetube.video.pojo.Barrage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(name = "video")
@RequestMapping("/category")
public interface CategoryFeign {
    public interface BarrageFeign {
        /**
         * 查询全部数据
         *
         * @return
         */
        @GetMapping
        public Result findAll();
        /***
         * 根据ID查询数据
         * @param id
         * @return
         */
        @GetMapping("/{id}")
        public Result findById(@PathVariable Integer id);
        /***
         * 新增数据
         * @param barrage
         * @return
         */
        @PostMapping
        public Result add(@RequestBody Barrage barrage);
        /***
         * 修改数据
         * @param barrage
         * @param id
         * @return
         */
        @PutMapping(value = "/{id}")
        public Result update(@RequestBody Barrage barrage, @PathVariable Integer id);

        /***
         * 根据ID删除品牌数据
         * @param id
         * @return
         */
        @DeleteMapping(value = "/{id}")
        public Result delete(@PathVariable Integer id);

        /***
         * 多条件搜索品牌数据
         * @param searchMap
         * @return
         */
        @GetMapping(value = "/search" )
        public Result findList(@RequestParam Map searchMap);

        /***
         * 分页搜索实现
         * @param searchMap
         * @param page
         * @param size
         * @return
         */
        @GetMapping(value = "/search/{page}/{size}" )
        public Result findPage(@RequestParam Map searchMap, @PathVariable  int page, @PathVariable  int size);
    }
}
